﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Workflow2211A.Consol.Steps;
using WorkflowCore.Interface;

namespace Workflow2211A.Consol.Workflows
{
    public class ForeachWorkflow : IWorkflow
    {
        public string Id => nameof(ForeachWorkflow);

        public int Version => 1;

        public void Build(IWorkflowBuilder<object> builder)
        {
            builder.StartWith<StartStep>()
                   .ForEach(data => new List<int> { 1, 2, 3, 4 },d=>false)//d=>false表示串行    
                   .Do(x =>//Do代表ForEach循环要干的事情
                   {
                       x.Then <AuditStep>(); //我在Foreach要做的事情是审批
                   })
                   .Then<EndStep>();
        }
    }
}
